package whf.framework.meta.entity;

import whf.framework.util.StringUtils;


/**
 * @author wanghaifeng
 *
 */
public class ObjectProperty extends AbstractProperty {
	private final static long serialVersionUID = 0;

	private Object boObject;

	/**
	 * 决定是否记录日志
	 * @modify 2008-1-21 下午09:54:58
	 */
	private boolean auditable;
	
	/**
	 * 是否建立全文索引
	 * @modify 2008-1-23 下午04:30:58
	 */
	private String indexType;
	
	public Object getBoObject() {
		return boObject;
	}

	public void setBoObject(Object boObject) {
		this.boObject = boObject;
//		if(!boObject.getProperties().contains(this)){
//			boObject.addProperty(this);
//		}
	}
	
	public boolean equals(java.lang.Object obj){
		if(!(obj instanceof ObjectProperty)) return false;
		ObjectProperty op = (ObjectProperty)obj;
		if(this.boObject == null || op.boObject == null) return false;
		return this.boObject.equals(op.boObject) && 
			StringUtils.equalsIgnoreCase(this.getName(), op.getName());
	}

	/**
	 * @return the auditable
	 */
	public boolean isAuditable() {
		return auditable;
	}

	/**
	 * @param auditable the auditable to set
	 */
	public void setAuditable(boolean auditable) {
		this.auditable = auditable;
	}

	/**
	 * @return the indexType
	 */
	public String getIndexType() {
		return indexType;
	}

	/**
	 * @param indexType the indexType to set
	 */
	public void setIndexType(String indexType) {
		this.indexType = indexType;
	}

}
